% sentence(Parse, [tu3, la5nh, sharp, sj16vsl, d9u7o75c, ba1n, o73, d9a6u], []).
% tủ_lạnh/máy_lạnh/tủ_đông sharp/samsung/lg xxx/yyy/zzz (được) bán ở đâu?
% tu3_la5nh/ma1y_la5nh/tu3_d9o6ng sharp/samsung/lg xxx/yyy/zzz (d9u7o75c) ba1n o73 d9a6u


sentence(s(NP,VP))-->np(NP), vp(VP).

np(np(N_sp, NE))-->n_sp(N_sp), ne(NE).

% cac loai san pham
n_sp(n_sp('tu3 la5nh'))-->[tu3, la5nh].
n_sp(n_sp('tu3 d9o6ng'))-->[tu3, d9o6ng].
n_sp(n_sp('tu3 ma1t'))-->[tu3, ma1t].
n_sp(n_sp('ma1y la5nh'))-->[ma1y, la5nh].
n_sp(n_sp('ma1y gia85t'))-->[ma1y, gia85t].
n_sp(n_sp('d9ie62u ho2a'))-->[d9ie62u, ho2a].

ne(ne(N_hsx, Pron_sp))-->n_hsx(N_hsx),!,pron_sp(Pron_sp).
ne(Pron_sp)-->pron_sp(Pron_sp).

% cac hang san xuat
n_hsx(n_hsx(panasonic))-->[panasonic].
n_hsx(n_hsx(daikin))-->[daikin].
n_hsx(n_hsx(lg))-->[lg].
n_hsx(n_hsx(samsung))-->[samsung].
n_hsx(n_hsx(mitsubishi))-->[mitsubishi].
n_hsx(n_hsx(electrolux))-->[electrolux].
n_hsx(n_hsx(sharp))-->[sharp].
n_hsx(n_hsx(sanyo))-->[sanyo].
n_hsx(n_hsx(hitachi))-->[hitachi].
n_hsx(n_hsx(gree))-->[gree].
% ma~ san pham
pron_sp(pron_sp(H))-->[H].

% cum dong tu
vp(vp(R, V, NP))-->r(R), v(V), np1(NP).

r(r(d9u7o75c))-->[d9u7o75c];[].
v(n_tuhoi('ba1n'))-->[ba1n]. % nếu tu_hoi = ba1n, thì thay tu_hoi = địa chỉ


% phu tu
np1(NP)-->r2(NP).

r2(r2('o73'))-->[o73].
r2(r2('o73 d9a6u'))-->[o73, d9a6u].